package com.ygxsk.carhome.response;

import android.os.Parcel;
import android.os.Parcelable;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.Transient;

/*
 * @Author:itchenqi175@163.com
 * @Time:2023-08-07  09:25
 * @Description:获取车辆的品牌 是一个较大的范畴，在车系之上
 */
@Entity(nameInDb = "CARBRANDLARGECATEGORY")//防止混淆变动 车辆的品牌
public class CarBrandLargeCategory implements Parcelable {

//    {
//            "carBrandId": 6,
//            "carBrandName": "比亚迪",
//            "createTime": "1900-01-21 01:11:25",
//            "initials": "B",
//            "isDelete": 0,
//            "isUsing": 1,
//            "logoImg": "http://222.222.17.184:8990/resource/car_brand/1690701998320_294.png",
//            "sortCode": 6,
//            "urlPrefix": ""
//    },

    // : 2023-08-07 10:19 将来要做搜索的
    @Id(autoincrement = true)//主键自动增长
    @Property(nameInDb = "NUMID")
    transient Long numId;

    //车辆品牌的id
    @Property(nameInDb = "CARBRANDID")
    private String carBrandId;
    //车辆品牌的名称
    @Property(nameInDb = "CARBRANDNAME")
    private String carBrandName;
    //车辆品牌的logo-不存入；
    @Transient
    private transient String logoImg;
    //车辆型号的排序
    @Transient
    private transient String sortCode;

    @Transient
    private transient boolean isChecked;

    @Transient
    private boolean defaultValue;
//    private transient boolean default;

    @Generated(hash = 467346415)
    public CarBrandLargeCategory(String carBrandId, String carBrandName) {
        this.carBrandId = carBrandId;
        this.carBrandName = carBrandName;
    }

    @Generated(hash = 500994024)
    public CarBrandLargeCategory() {
    }

    public Long getNumId() {
        return numId;
    }

    public void setNumId(Long numId) {
        this.numId = numId;
    }

    public boolean isChecked() {
        return isChecked;
    }

    public void setChecked(boolean checked) {
        isChecked = checked;
    }

    public String getSortCode() {
        return sortCode;
    }

    public void setSortCode(String sortCode) {
        this.sortCode = sortCode;
    }

    public String getCarBrandId() {
        return carBrandId;
    }

    public void setCarBrandId(String carBrandId) {
        this.carBrandId = carBrandId;
    }

    public String getCarBrandName() {
        return carBrandName;
    }

    public void setCarBrandName(String carBrandName) {
        this.carBrandName = carBrandName;
    }

    public String getLogoImg() {
        return logoImg;
    }

    public void setLogoImg(String logoImg) {
        this.logoImg = logoImg;
    }


    public boolean isDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(boolean defaultValue) {
        this.defaultValue = defaultValue;
    }

    @Override
    public String toString() {
        return "CarBrandLargeCategory{" +
                "carBrandId='" + carBrandId + '\'' +
                ", carBrandName='" + carBrandName + '\'' +
                ", logoImg='" + logoImg + '\'' +
                ", sortCode='" + sortCode + '\'' +
                ", isChecked=" + isChecked +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.carBrandId);
        dest.writeString(this.carBrandName);
        dest.writeByte(this.defaultValue ? (byte) 1 : (byte) 0);
    }

    public void readFromParcel(Parcel source) {
        this.carBrandId = source.readString();
        this.carBrandName = source.readString();
        this.defaultValue = source.readByte() != 0;
    }

    protected CarBrandLargeCategory(Parcel in) {
        this.carBrandId = in.readString();
        this.carBrandName = in.readString();
        this.defaultValue = in.readByte() != 0;
    }

    public static final Parcelable.Creator<CarBrandLargeCategory> CREATOR = new Parcelable.Creator<CarBrandLargeCategory>() {
        @Override
        public CarBrandLargeCategory createFromParcel(Parcel source) {
            return new CarBrandLargeCategory(source);
        }

        @Override
        public CarBrandLargeCategory[] newArray(int size) {
            return new CarBrandLargeCategory[size];
        }
    };
}
